<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-user_id"  name="row[user_id]" type="hidden" value="2">
        </div>
    </div>
<!--    <div class="form-group" style="color: red">-->
<!--        <label class="control-label col-xs-12 col-sm-2"></label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            * 团队选择是否需要调解员时，如果改变日期时请重新选择一下是否需要调解员-->
<!--        </div>-->
<!--    </div>-->
    {if   $Think.session.rule_id eq 1 or  $Think.session.rule_id eq 5}
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-name" data-rule="required" {if  $Think.session.rule_id eq 5 }readonly{/if} {if  $Think.session.rule_id eq 3 }readonly{/if} class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
            </div>
        </div>
    {/if}
    {if   $Think.session.rule_id eq 1 }
        <div class="form-group" >
            <label class="control-label col-xs-12 col-sm-2">{:__('预约状态')}:</label>
            <div class="col-xs-12 col-sm-8" >
                {:build_select('row[status]',[ '1'=>__('预约中'),'2'=>__('完成评价'),'3'=>__('取消预约'),'4'=>__('完成参观'),'5'=>__('特殊预留'),'6'=>__('未参观')], $row['status'])}
            </div>
        </div>
    {/if}
    {if   $Think.session.rule_id eq 1 or  $Think.session.rule_id eq 5}
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-mobile" data-rule="required" {if  $Think.session.rule_id eq 5 }readonly{/if} {if  $Think.session.rule_id eq 3 }readonly{/if}  class="form-control" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}">
            </div>
        </div>
    {/if}

    {if   $Think.session.rule_id eq 1 or  $Think.session.rule_id eq 5}
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Venue')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select name="row[venue]" class="form-control selectpicker" {if  $Think.session.rule_id eq 5 }disabled="disabled"{/if} {if  $Think.session.rule_id eq 3 }readonly{/if}>
                    <option value="A" {if $row.venue == 'A'} selected {/if}>北山街馆区</option>
                    <option value="B"  {if $row.venue == 'B'} selected {/if}>栖霞岭馆区</option>
                </select>
            </div>
        </div>
    {/if}
      {if $row['type'] neq 0 }
        {if   $Think.session.rule_id eq 1  or  $Think.session.rule_id eq 5}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Company')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-company" data-rule="required" class="form-control" {if  $Think.session.rule_id eq 5 }readonly{/if} {if  $Think.session.rule_id eq 3 }readonly{/if}  name="row[company]" type="text" value="{$row.company|htmlentities}">
                </div>
            </div>
        {/if}
    {/if}

     {if $row['type'] eq 0 }
        {if   $Think.session.rule_id eq 1 }
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('政治面貌')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <select class="form-control tiaojie" name="row[department]" {if  $Think.session.rule_id eq 5 }readonly{/if} {if  $Think.session.rule_id eq 3 }readonly{/if}  >
                            {foreach $department as $k=>$v}
                            <option value="{$v}" {if $row.department eq $v} selected{/if}>{$v}</option>
                            {/foreach}
                        </select>
                </div>
            </div>
        {/if}
    {/if}

      {if $row['type'] neq 0 }
        {if   $Think.session.rule_id eq 1 }
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('单位类型')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <select class="form-control " name="row[position_type]" {if  $Think.session.rule_id eq 5 }readonly{/if} {if  $Think.session.rule_id eq 3 }readonly{/if}  >
                        {foreach $position_type as $k=>$v}
                        <option value="{$v}" {if $row.position_type eq $v} selected{/if}>{$v}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        {/if}
    {/if}
      {if $row['type'] neq 0 }
        {if   $Think.session.rule_id eq 1 or  $Think.session.rule_id eq 5}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-views" data-rule="required" class="form-control"  {if  $Think.session.rule_id eq 5 }readonly{/if} {if  $Think.session.rule_id eq 3 }readonly{/if}  name="row[views]" type="number" value="{$row.views|htmlentities}">
                </div>
            </div>
        {/if}
    {/if}
    {if   $Think.session.rule_id eq 1 or  $Think.session.rule_id eq 5}
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Day')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-day" data-rule="required" class="form-control" {if  $Think.session.rule_id eq 5 }readonly{/if} {if  $Think.session.rule_id eq 3 }readonly{/if}  name="row[day]" type="date" value="{$row.day|htmlentities}">
            </div>
        </div>
    {/if}
    {if   $Think.session.rule_id eq 1  or  $Think.session.rule_id eq 5}
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Between_time')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select class="form-control between_time" {if  $Think.session.rule_id eq 5 }disabled="disabled"{/if} {if  $Think.session.rule_id eq 3 }readonly{/if}  name="row[between_time]">
                    {foreach $vistime as $k=>$val}
                    {if condition="$k eq $row.between_time"}
                          <option value="{$k}" selected>{$val}</option>
                        {else/}
                          <option value="{$k}" >{$val}</option>
                    {/if}

                    {/foreach}
                </select>
            </div>
        </div>
    {/if}
    {if $row['type'] neq 0 }
        {if   $Think.session.rule_id eq 1 }
            <div class="form-group "  >
                <label class="control-label col-xs-12 col-sm-2">{:__('讲解')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <select name="row[explain]" class="explain form-control " {if  $Think.session.rule_id eq 5 }readonly{/if} {if  $Think.session.rule_id eq 3 }readonly{/if} >
                        <option value="0"   {if  $row['explain'] eq 0} selected {/if}>不需要</option>
                        <option value="1"   {if  $row['explain'] eq 1} selected {/if}>需要</option>
                    </select>
                </div>
            </div>
        {/if}
    {/if}

<!--    {if $row['type'] neq 0 }-->
        {if $row['explain'] == 1}
             {if  $Think.session.rule_id eq 3 or $Think.session.rule_id eq 1 }
                    <div class="form-group speak" >
                        <label class="control-label col-xs-12 col-sm-2">{:__('讲解员')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <select class="form-control tiaojie" name="row[admin_id]" {if  $Think.session.rule_id eq 5 }readonly{/if} >
                            {if  $Think.session.rule_id eq 3}
                                 <option value="{$Think.session.admin.id}" >{$Think.session.admin.nickname}</option>

                                {else/}
                                <option value="" >--请选择--</option>
                                {foreach $name as $k=>$val}
                                {if condition="$k eq $row.admin_id"}
                                <option value="{$k}" selected>{$val}</option>
                                {else/}
                                <option value="{$k}" >{$val}</option>
                                {/if}
                                {/foreach}
                            {/if}

                            </select>
                        </div>
                    </div>
            {/if}
        {/if}
    {if $row['type'] neq 0 }
        {if  $Think.session.rule_id eq 5 or $Think.session.rule_id eq 1 }
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('实际人数')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-actual_views"      class="form-control" name="row[actual_views]" type="number" value="{$row.actual_views|htmlentities}">
                </div>
            </div>
        {/if}
    {/if}
<!--    {/if}-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Between_day')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-between_day" data-rule="required" class="form-control" name="row[between_day]" type="text" value="{$row.between_day|htmlentities}">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Reason')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-reason" data-rule="required" class="form-control" name="row[reason]" type="text" value="{$row.reason|htmlentities}">-->
<!--        </div>-->
<!--    </div>-->
       <!-- <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('特殊预留')}:</label>
            <div class="col-xs-12 col-sm-8">
                {if condition="$row['status'] eq 5 " }
                      {:build_radios('row[status]', ['1'=>__('取消预留')], $row['status']);}
                    {else/}
                     {:build_radios('row[status]', ['5'=>__('预留')], $row['status']);}
                {/if}

            </div>
        </div>-->
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script src="/lib/jquery/1.9.1/jquery.min.js"></script>
<script>
// $(".explain").change(function(){
//         if($(".explain").val() == 1){
//             if($("#c-day").val() == ""){
//                 return false
//             }
//             var time = $("#c-day").val();
//             var Between_time =  $(".between_time").val();
//             var url = "Visiting/gettiaojie?day="+time+"&between_time="+Between_time;
//             $.ajax({
//                 type: "GET",
//                 dataType: "json",
//                 url: url,
//                 success: function (data) {
//                     if(data.data == ""){
//                         $(".speak").css("display","none");
//                         return;
//                     }else{
//                         if(data.code == 1 ){
//                             // console.log(data);
//                             $(".tiaojie").find("option").remove();
//                             $.each(data.data,function(i,val){
//                                 $(".tiaojie").append(
//                                     '<option value="'+val.users.id+'" >' +
//                                     val.users.nickname+ "</option>")
//                             })
//                             $(".speak").css("display","block");
//                         }
//                     }
//                 }
//             })
//         }else{
//             $(".speak").css("display","none");
//         }
//     }
// )

$(".moshi").change(function(){
        if($(".moshi").val() == 1){
            $(".tuanti").css("display","block");
        }else{
            $(".tuanti").css("display","none");
        }
    }

)

</script>

